<template>
	<view class="">
		<!-- 新闻区域 -->
		<view class="new">
			
			<view class="newList">
				<view class="ListItem" v-for="(item) in newList" :key="item.id" @click="todetail(item.id)">
					<view class="img">
						<image :src="item.cover"></image>
					</view>
					<view class="right">
						<view class="title one-ellipsis">{{item.title}}</view>
						<view class="createTime">{{item.createTime}}</view>
					</view>
				</view>
				<view class="" v-if="newList.length==0">
					暂无数据...
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import {
		getFundList
	} from '../../api/fund'
	export default {
		data() {
			return {
				newList: []
			}
		},
		onLoad() {
			this.getFundListFn()
		},
		methods: {
			todetail(id) {
				uni.navigateTo({
					url: `/pages/fund/fundDetail?id=${id}`
				})
			},
			async getFundListFn() {
				let res = await getFundList({
					id: ""
				})
				this.newList = res.data.data
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f3f3f3;
	}

	.new {
		margin: 30rpx;
		padding: 20rpx;
		background-color: #ffff;
		border-radius: 20rpx;

		.newList {
			.ListItem {
				display: flex;
				margin-bottom: 10px;

				.img {
					width: 200rpx;
					height: 150rpx;

					image {
						width: 200rpx;
						height: 150rpx;
						border-radius: 10rpx;
						display: block;
					}
				}

				.right {
					margin-left: 20rpx;
					display: flex;
					flex-direction: column;
					flex-wrap: nowrap;
					justify-content: space-between;

					.title {
						font-weight: 550;
						font-size: 28rpx;
					}

					.createTime {
						color: #8f8c84;
						font-size: 25rpx;
					}
				}
			}
		}
	}
</style>